#ifndef DEVICECODEWIDGET_H
#define DEVICECODEWIDGET_H

#include <QDialog>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QLabel>
#include <QPushButton>
#include <QLineEdit>
#include <QDebug>
#include <QKeyEvent>

class DeviceCodeWidget : public QWidget
{
    Q_OBJECT
public:
    explicit DeviceCodeWidget(QWidget *parent = nullptr);

private Q_SLOTS:
    void slotStartConnectBtnClicked();
Q_SIGNALS:
    void sigLineEditText(QString lineEditText);

protected:
    void keyPressEvent(QKeyEvent *event) override;

private:
    void initUI();

    QString getCodeText();

private:
    QPushButton *m_firstBtn = nullptr;
    QPushButton *m_secondBtn = nullptr;
    QPushButton *m_thirdBtn = nullptr;
    QPushButton *m_fourthBtn = nullptr;
    QPushButton *m_fifthBtn = nullptr;
    QPushButton *m_sixthBtn = nullptr;
    QPushButton *m_seventhBtn = nullptr;
    QPushButton *m_eighthBtn = nullptr;
    int m_index = 0;
    QPushButton *m_startConnectBtn = nullptr;
};

#endif // DEVICECODEWIDGET_H
